var express = require('express')
var app = express()
var http = require('http').Server(app)
var io = require('socket.io')(http)

app.get('/', function(req, res){
    res.sendFile(__dirname + '/index.html')
})

io.on('connection', function(socket){
    socket.on('chat msg', function(msg){
        io.emit('chat msg', msg)
    })
})

app.use(express.static(__dirname))
http.listen(3000, function(){
    console.log('listen in 3000')
})